/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bkt.client;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.mobile.device.Device;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 *
 * @author boniface
 */
@Controller
public class HomeController {

    private static final Logger logger = LoggerFactory.getLogger(HomeController.class);

    @RequestMapping({"/"})
    public String home(Device device) {

        if (device.isMobile()) {
            logger.info("Re-Directing to Mobile Application");
            return "home";
        } else {
            logger.info("Re-Directing to Desktop Application");

            // return "desktop"; 
            //Uncoment Above for Deployment
            return "home";
        }

    }
}